The present invention relates file systems, and more particularly to the management, writing, and reading of a file on a file system.
LTFS (Linear Tape File System) is a mechanism for accessing data in a tape drive as a file in a file system. In the LTFS, metadata (such as the position and size of a data area) indicating the position on a tape of the data area constituting the file, and the like, is stored as an index in the file system. The use of LTFS enables use of the tape as a storage destination of the file in a manner similar to that of a storage device such as an HDD or a USB memory.
In the LTFS, upon editing (updating) a file, data of files previously written to the tape are not overwritten. Rather, edited data is appended after the previously written data. Upon reading data, the data is read after a magnetic head and the tape are aligned in a position where the data is written (movement of the tape and/or the magnetic head). The positioning may take time, and if an application created on the assumption of use of an HDD or a USB memory is applied to the tape, the speed of file reading operations may be very slow.
For example, as shown in FIG. 1, it is assumed that file A, file B, and file C are written on the tape in this order. In this case, when the file A is read after the file B is read, the head needs to be moved (by rewinding the tape) to position a after the head reads data from position c to position d on the tape (R1) to read data of the file A up to position b (R2). It may take several seconds to several tens of seconds for this movement of the head (to rewind the tape). In such a case, if an application created on the assumption of use of an HDD or a USB memory is used, a problem may occur due to relatively slow read operation.